// 根据vue-element-admin 封装的request
// https://github.com/PanJiaChen/vue-element-admin/blob/master/src/utils/request.js

import axios from 'axios'
// import { Message } from 'element-ui'

// create an axios instance
const service = axios.create({
  baseURL: 'https://admin.fxlkg.com/api/v1/', // api 的 base_url
  timeout: 5000, // request timeout,
  headers: {
    'Content-Type': 'text/plain'
  }
})


// response interceptor
service.interceptors.response.use(
  response => response,
  error => {
    // console.log('err' + error) // for debug
    // Message({
    //   message: error.message,
    //   type: 'error',
    //   duration: 5 * 1000
    // })
    return Promise.reject(error)
  }
)

export default service